Scenario #2012: Create External Debitor for Partner

UseCase Create External Debitor For Partner => Debitor: D-3101002 - Test AG - external debitor

Properties

Required

Given

name value
partnerPersonTradeName Test AG
billingContactCaption Billing GmbH - billing department
billingContactEmailAddress billing@test-ag.example.org
debitorNumberSuffix 02
billable true
vatId VAT123456
vatCountryCode DE
vatBusiness true
vatReverseCharge false
defaultPrefix tsy

Person: Test AG

HTTP GET "/api/hs/office/persons?name=Test+AG" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "1223603d-1a3b-4e0c-a244-027585d22eb2", // partnerPersonUuid
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

BankAccount: Billing GmbH - refund bank account

HTTP POST "/api/hs/office/bankaccounts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  -H 'Content-Type: application/json' \
  --data-binary @- <<EOF
{
  "holder" : "Billing GmbH - refund bank account",
  "iban" : "DE02120300000000202051",
  "bic" : "BYLADEM1001"
}
EOF
=> status: 201 CREATED ab40db0b-447f-40cd-bac0-37f377916aa2

Contact: Billing GmbH - Test AG billing

HTTP POST "/api/hs/office/contacts" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  -H 'Content-Type: application/json' \
  --data-binary @- <<EOF
{
  "caption" : "Billing GmbH, billing for Test AG",
  "emailAddresses" : {
    "main" : "test-ag@billing-GmbH.example.com"
  }
}
EOF
=> status: 201 CREATED 382d74b7-b383-470f-905e-acc757d9f3ca

Create Debitor: D-3101002 - Test AG - external debitor

HTTP POST "/api/hs/office/debitors" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  -H 'Content-Type: application/json' \
  --data-binary @- <<EOF
{
  "debitorRel" : {
    "anchor.uuid" : "1223603d-1a3b-4e0c-a244-027585d22eb2", // Person: Test AG
    "holder.uuid" : "38597e92-3970-4b4a-96bd-220fe1a76965", // Person: Billing GmbH
    "contact.uuid" : "382d74b7-b383-470f-905e-acc757d9f3ca" // Contact: Billing GmbH - Test AG billing
  },
  "debitorNumberSuffix" : "02",
  "billable" : true,
  "vatId" : "VAT123456",
  "vatCountryCode" : "DE",
  "vatBusiness" : true,
  "vatReverseCharge" : false,
  "refundBankAccount.uuid" : "ab40db0b-447f-40cd-bac0-37f377916aa2", // BankAccount: Billing GmbH - refund bank account
  "defaultPrefix" : "tsy"
}
EOF
=> status: 201 CREATED f93addae-dc89-40ce-8f35-26755cd80535

generated on 2026-07-17 01:42:26 for branch